import { Spin } from "antd/lib"
import styles from './index.less';
import { ReactNode } from "react";

type Props = {
    loading:boolean,
    children:ReactNode,
    size?:'small'|'default'|'large'
}
export default ({
    loading,
    children,
    size="default"
}:Props) =>{
    return loading ? <div className={styles.container}><Spin size={size} /></div> :<>
        {children}
    </>
}